package agile.hustler.activities;

import java.io.File;

import agile.hustler.activities.R;
import agile.hustler.activities.R.layout;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Handler;

public class Hustler extends Activity {
    /** Called when the activity is first created. */
    private final int SPLASH_DISPLAY_LENGHT = 3000;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splashscreen);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        
 	   File datadir = new File("/sdcard/hustlerdata/");
	   datadir.mkdirs();
        
        /* New Handler to start the Menu-Activity
         * and close this Splash-Screen after some seconds.*/
        new Handler().postDelayed(new Runnable(){
            public void run() {
                  /* Create an Intent that will start the Menu-Activity. */
                  Intent mainIntent = new Intent(Hustler.this,StartScreen.class);
                  Hustler.this.startActivity(mainIntent);
                  Hustler.this.finish();
                  System.gc();
            }
      }, SPLASH_DISPLAY_LENGHT);
        
    }
}